home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Serial_Demo;
-
-
- { Pascal source: Serial.Pas}
- { Resources: Serial.R}
-
- {$R-}
- {$I-}
- USES
- Globals, GPLib, HandleChars, initprogram, Menus, Misc;
-
- PROCEDURE mainloop;
- BEGIN
- SystemTask;
- Get_comm_input;
- IF GetNextEvent(everyEvent, myEvent) THEN
- CASE myEvent.what OF
- mouseDown :
- BEGIN
- code := FindWindow(myEvent.where, whichWindow);
- CASE code OF
- inMenuBar :
- DoCommand(MenuSelect(myEvent.where));
- inSysWindow :
- SystemClick(myEvent, whichWindow);
- inDrag :
- IF whichWindow <> FrontWindow THEN
- SelectNewWindow
- ELSE
- DragWindow(whichWindow, myEvent.where, dragRect);
-
- inContent :
- IF whichWindow <> FrontWindow THEN
- SelectNewWindow;
- END;{ of code case }
- END; { of mouseDown }
-
- keyDown, autoKey :
- Handle_keys(chr(LoWord(myEvent.message)));
-
- activateEvt :
- BEGIN
- whichWindow := WindowPtr(myEvent.message);
- IF ODD(myEvent.modifiers) THEN
- SetPort(whichWindow);
- END; { of activateEvt }
-
- updateEvt :
- BEGIN
- GetPort(savePort);
- whichWindow := WindowPtr(myEvent.message);
- SetPort(whichWindow);
- BeginUpdate(whichWindow);
- EndUpdate(whichWindow);
- SetPort(savePort);
- END { of updateEvt }
- END { of event case }
- END;
-
- BEGIN { main program }
- initall;
- UnloadSeg(@initall);
- newWindows; { open the Printer window - B - first }
- rowB := row;
- columnB := column;
- WindowB := theWindow;
- newWindows; { open the modem window -A}
- rowA := row;
- columnA := column;
- WindowA := theWindow;
- RSerBuf(outrefnumA);
- REPEAT
- mainloop;
- UNTIL doneFlag
- END.